home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 461 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.std.c
  4. Subject: Re: sizeof(char) ~= sizeof(float)
  5. Date: 27 Feb 1996 18:42:01 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb27114201@qcd.lanl.gov>
  8. References: <WALD.96Feb24131532@woodpecker.lcs.mit.edu> <4gr3d1$dca@usenet.pa.dec.com>
  9.     <TANMOY.96Feb25203514@qcd.lanl.gov>
  10.     <DnFr78.1wo@ukpsshp1.serigate.philips.nl>
  11. NNTP-Posting-Host: qcd.lanl.gov
  12. Mime-Version: 1.0
  13. Content-Type: text
  14. In-reply-to: baynes@ukpsshp1.serigate.philips.nl's message of Tue, 27 Feb 1996 13:09:08 GMT
  15.  
  16. In article <DnFr78.1wo@ukpsshp1.serigate.philips.nl>
  17. baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) writes:
  18.  
  19. SB: Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
  20. SB: : In article <4gr3d1$dca@usenet.pa.dec.com>
  21. SB: : diamond@tbj.dec.com (Norman Diamond) writes:
  22. SB: <snip - copying data by using chars of different sorts vs memcpy >
  23. SB: : This was a free-standing implementation, and memcpy may be absent. (In
  24. SB: : a hosted implementation, as all read/write is done as if through
  25. SB: : getc/putc which handles unsigned char values, and binary files written
  26. SB: : out must be read back unchanged, the situation is impossible).
  27. SB: 
  28. SB: That read/write is done by getc/putc does not imply very much about copying
  29. SB: chars. I don't see any requirement that fwrite/fread use one putc/getc per
  30. SB: byte(ie char) of memory. Fwrite could use one per bit writing the
  31. values 'Y' or 
  32. SB: 'N' if it wanted so long as fread will read it back again. My
  33. understanding 
  34. SB: is that the use of getc/putc means you can write a file with
  35. fwrite, copy it 
  36. SB: with getc/putc and read the copy with fread to get what you started with.
  37.  
  38. I understood it to mean that I could take the same (void*) pointer to
  39. the data, and call putc repeatedly on the successive bytes of the
  40. data, and the resulting file is identical to doing an fwrite. I think
  41. the standard should clarify its meaning.
  42.  
  43. Cheers
  44. Tanmoy
  45. --
  46. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  47. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  48. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  49. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  50. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  51. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  52.